﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Data;
using Entity;

namespace Business
{
   public class Orders_Business
    {
       public bool Add_Orders(Orders_Entity orders)
       {
           Orders_Data add_orders = new Orders_Data();
           return add_orders.Insert_orders(orders);
       }

       public DataTable Load()
       {
           Orders_Data orders = new Orders_Data();
           try
           {
               return orders.Load();
           }
           catch
           {
               throw;
           }
           finally
           {
               orders = null;
           }
       }
       public int Update(int orderid, int cusid, string receivename, string receiveaddress, int receivephone, DateTime senddate, DateTime receivedate, int weight, int provinceid, int serid, int price, string status)
       {
           Orders_Data a = new Orders_Data();
           try
           {
               return a.Update_orders(orderid,cusid,receivename,receiveaddress,receivephone,senddate,receivedate,weight,provinceid,serid,price,status);
           }
           catch
           {
               throw;
           }
           finally
           {
               a = null;
           }
       }

       public int Delete(int ordersid)
       {
           Orders_Data orders = new Orders_Data();
           try
           {
               return orders.Delete_orders(ordersid);
           }
           catch
           {
               throw;
           }
           finally
           {
               orders = null;
           }
       }
    }
}
